﻿using System.Reflection;

namespace _78_C_获取反射方法的参数类型
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Assembly assembly = Assembly.LoadFrom("TestClassLibrary.dll");
            Type type = assembly.GetType("TestClassLibrary.Student");
            MethodInfo methodInfo = type.GetMethod("showName");
            ParameterInfo[] parameters = methodInfo.GetParameters();

            foreach (ParameterInfo pi in parameters)
            {
                Console.WriteLine($"参数的名称是：{pi.Name}  类型名称： {pi.ParameterType.Name}");
            }
        }
    }
}
